Nationwide cost estimates of 60 major illnesses place alcohol use disorders as the 2nd and drug use disorders as the 7th most costly health problems.3 Both are related to higher rates of HIV risk behaviors associated with the human immunodeficiency virus (HIV) and together they represent 3 of the top 10 modifiable behavioral causes of mortality in the US. Studies indicate that effective strategies for managing substance use disorders (SUD) must address its chronic and cyclical nature, of which HIV risk is a part.4-9 For many, substance use creates circumstances that increase HIV risk (e.g., needle use, trading sex) and for others, substance use is a coping mechanism for the negative impact of lifestyle choices (e.g. illegal activity, losing custody of their children, trading sex). Post-discarge monitoring, feedback and early re- intervention have become standard practice when managing numerous chronic conditions.10 Mobile technology has the potential to radically improve the odds of sustained recovery by providing tools for ongoing monitoring, assessment and access to recovery support interventions anytime and anywhere. This is particularly important for the 90% of those needing treatment that don't receive it. Therefore applying smartphone technology to provide recovery management anytime anywhere is potentially significant. The proposed trial is designed to test the effectiveness of using smartphones to provide post-treatment support services via ecological momentary assessments (EMA), ecological momentary interventions (EMI) and their combination on substance use disorders and HIV risk in a 2 x 2 factorial design. Participants (n=400) will be recruited and interviewed after treatment discharge, randomized, interviewed again at 3 and 6 months. Those in the EMA groups will be asked 6 times per day to record their recent exposure to risk factors and then rate the extent to which these factors are making them want to use or be in recovery. Individuals in the EMI groups will have real-time access to a suite of smartphone-based recovery support services designed to motivate them, help them cope with potential relapse triggers, and connect them to social support. In the EMA+EMI condition, the EMA responses will be used to generate immediate feedback on relapse and HIV risk. AIMS are to: 1) Test the effect of EMA, EMI and EMA+EMI on days of abstinence, 2) Test the effect of EMA, EMI and EMA+EMI on HIV risk behaviors, and 3) Evaluate the extent to which changes in days of abstinence mediate the effect of EMA, EMI, and EMA+EMI on HIV risk behaviors.